package org.ayachinene.leetcode.problems;

public class P2315 {

    static class Solution {
        public int countAsterisks(String s) {
            int res = 0;
            boolean inPair = false;
            for (char c : s.toCharArray()) {
                if (c == '|') {
                    inPair = !inPair;
                    continue;
                }
                if (!inPair && c == '*') {
                    res++;
                }
            }
            return res;
        }
    }
}
